<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'estate.label', default: 'OtherCollateral')}"/>
    <title>新增仓单</title>
</head>

<body>
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>PLS CINDATA</li>
                    <li>
                        <g:link controller="menu" action="index">CINDATA</g:link>
                    </li>
                    <li class="active">
                        <span>新增仓单</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                新增仓单
            </h2>
        </div>
    </div>
</div>

<g:form action="save">
    <g:if test="${flash.message}">
        <div class="message alert alert-info" role="status">${flash.message}</div>
    </g:if>
    <g:hasErrors bean="${this.menu}">
        <ul class="errors" role="alert">
            <g:eachError bean="${this.menu}" var="error">
                <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message
                        error="${error}"/></li>
            </g:eachError>
        </ul>
    </g:hasErrors>

    <div class="content animate-panel">
        <div class="row">
            <div class="hpanel hred">
                <div class="panel-heading">
                    关联贷款信息
                </div>
                <div class="panel-body form-horizontal">
                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">贷款</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" multiple="multiple" name="mortgageList" id="mortgageList" from="${com.cindata.Mortgage.list(max: 1000)}" optionValue="serialNumber" optionKey="id" value="${this?.vehicle?.mortgage?.id}" noSelection="${['': '请选择贷款']}"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <div class="content animate-panel">
        <div class="row">
            <div class="hpanel hblue">
                <div class="panel-heading">
                    仓单基本信息
                </div>

                <div class="panel-body form-horizontal">

                    <div class="form-group">

                        <label class="col-md-2 control-label is-required">省份</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="province" id="province" from="${com.cindata.Province.list()}" optionValue="name" optionKey="id" value="${this?.otherCollateral?.province?.id}" noSelection="${['': '请选择省份']}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">押品状态</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="estateStatus" id="estateStatus" from="${com.cindata.dictionary.EstateStatusDict.list()}" optionValue="name" optionKey="id" value="${this?.otherCollateral?.estateStatus?.id}" noSelection="${['': '请选择押品状态']}"/>
                        </div>

                        <label class="col-md-2 control-label is-required">城市</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="city" id="city" from="${com.cindata.City.findAllByNameInList(new com.cindata.ComponentService().evaluate(com.cindata.Component.findByCode('showCity')), [sort: 'name', order: 'asc'])}" optionValue="name" optionKey="id" value="${this?.otherCollateral?.city?.id}" noSelection="${['': '请选择市']}"/>
                        </div>

                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">是否在押</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="isEstate" id="isEstate" value="${this.otherCollateral?.isEstate}"/>
                        </div>

                        <label class="col-md-2 control-label is-required">区域</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="district" id="district" from="${com.cindata.District.list()}" optionValue="name" optionKey="id" value="${this?.otherCollateral?.district?.id}" noSelection="${['': '请选择区域']}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">评估单价</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="unitPrice" id="unitPrice" value="${this.otherCollateral?.unitPrice}"/>
                        </div>

                        <label class="col-md-2 control-label is-required">评估总价</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="totalPrice" id="totalPrice" value="${this.otherCollateral?.totalPrice}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">评估时间</label>
                        <div class="col-md-3">
                            <g:datePicker class="form-control" name="valuationDate" value="${new Date()}" precision="day"/>
                        </div>

                        <label class="col-md-2 control-label is-required">抵押率 （%）</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="ltv" id="ltv" value="${this.otherCollateral?.ltv}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">直属管理机构</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="account" id="account" from="${com.cindata.Account.findAllByType(com.cindata.dictionary.AccountTypeDict.BANK())}" optionValue="name" optionKey="id" value="${this?.otherCollateral?.account?.id}" noSelection="${['': '请选择直属管理机构']}"/>
                        </div>

                        <label class="col-md-2 control-label is-required">动态抵押率 （%）</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="cltv" id="cltv" value="${this.otherCollateral?.cltv}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">贷款状态</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="mortgageStatus" id="mortgageStatus" from="${com.cindata.dictionary.MortgageStatusDict.list()}" optionValue="name" optionKey="id" value="${this?.otherCollateral?.mortgageStatus?.id}" noSelection="${['': '请选择贷款状态']}"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="content animate-panel">
        <div class="row">
            <div class="hpanel hyellow">
                <div class="panel-heading">
                    仓单主体信息
                </div>

                <div class="panel-body form-horizontal">

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">质押物编号</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="externalId" id="externalId" value="${this.otherCollateral?.externalId}"/>
                        </div>
                        <label class="col-md-2 control-label">质押物类型</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="typeId" id="typeId" from="${com.cindata.dictionary.OtherCollateralTypeDict.list()}" optionValue="name" optionKey="id" value="${com.cindata.dictionary.OtherCollateralTypeDict.findByName('存货')?.id}" noSelection="${['': '请选择贷款']}" disabled="true"/>
                            <g:select class="form-control m-b hidden" name="type" id="type" from="${com.cindata.dictionary.OtherCollateralTypeDict.list()}" optionValue="name" optionKey="id" value="${com.cindata.dictionary.OtherCollateralTypeDict.findByName('存货')?.id}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">质押物名称</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="name" id="name" value="${this.otherCollateral?.name}"/>
                        </div>
                        <label class="col-md-2 control-label">所有权编号</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="ownershipNumber" id="ownershipNumber" value="${this.otherCollateral?.ownershipNumber}"/>
                        </div>

                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">出质人名称</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="fullName" id="fullName" value="${this.otherCollateral?.fullName}"/>
                        </div>

                        <label class="col-md-2 control-label">出质人证件类型</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="identityType" id="identityType" from="${com.cindata.dictionary.ContactIdentityType.list()}" optionValue="name" optionKey="id" value="${this?.otherCollateral?.identityType?.id}" noSelection="${['': '请选择证件类型']}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">出质人贷款卡编号</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="loanCardNumber" id="loanCardNumber" value="${this.otherCollateral?.loanCardNumber}"/>
                        </div>

                        <label class="col-md-2 control-label">出质人证件号码</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="idNumber" id="idNumber" value="${this.otherCollateral?.idNumber}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">其他共同所有人</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="commonOwnerFullName" id="commonOwnerFullName" value="${this.otherCollateral?.commonOwnerFullName}"/>
                        </div>

                        <label class="col-md-2 control-label">所占份额</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="sharePoint" id="sharePoint" value="${this.otherCollateral?.sharePoint}"/>
                        </div>
                    </div>




                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">仓单/提货单出具日期</label>
                        <div class="col-md-3">
                            <g:datePicker class="form-control" name="startDate" value="${new Date()}" precision="day"/>
                        </div>
                        <label class="col-md-2 control-label is-required">仓单/提货单编号</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="billNumber" id="billNumber" value="${this.otherCollateral?.billNumber}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">仓储方名称</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="storehouseName" id="storehouseName" value="${this.otherCollateral?.storehouseName}"/>
                        </div>
                        <label class="col-md-2 control-label is-required">是否输出监管</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="isExportUnderSupervise" id="isExportUnderSupervise" value="${this.otherCollateral?.isExportUnderSupervise}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">质物仓储地点</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="storehouseAddress" id="storehouseAddress" value="${this.otherCollateral?.storehouseAddress}"/>
                        </div>
                        <label class="col-md-2 control-label is-required">入库验收单号</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="acceptanceNumber" id="acceptanceNumber" value="${this.otherCollateral?.acceptanceNumber}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">仓储货位号</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="warehouseNumber" id="warehouseNumber" value="${this.otherCollateral?.warehouseNumber}"/>
                        </div>
                        <label class="col-md-2 control-label is-required">质物入库日期</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="pledgeStorageDate" id="pledgeStorageDate" value="${this.otherCollateral?.pledgeStorageDate}"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">质物详细品名</label>
                        <div class="col-md-3"> 
                        <g:textField class="form-control" type="text" name="pledgeDetail" id="pledgeDetail" value="${this.otherCollateral?.pledgeDetail}"/>
                        </div>
                        <label class="col-md-2 control-label is-required">质物规格</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="pledgeSpecification" id="pledgeSpecification" value="${this.otherCollateral?.pledgeSpecification}"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">质物型号</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="pledgeModel" id="pledgeModel" value="${this.otherCollateral?.pledgeModel}"/>
                        </div>
                        <label class="col-md-2 control-label is-required">质物等级</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="pledgeLevel" id="pledgeLevel" value="${this.otherCollateral?.pledgeLevel}"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">质物最低价值</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="pledgeMinPrice" id="pledgeMinPrice" value="${this.otherCollateral?.pledgeMinPrice}"/>
                        </div>
                        <label class="col-md-2 control-label is-required">质物最低数量</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="pledgeMinAmount" id="pledgeMinAmount" value="${this.otherCollateral?.pledgeMinAmount}"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">计价单位</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="valuationUnit" id="valuationUnit" value="${this.otherCollateral?.valuationUnit}"/>
                        </div>
                        <label class="col-md-2 control-label is-required">出质数量</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="pledgeAmount" id="pledgeAmount" value="${this.otherCollateral?.pledgeAmount}"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">出质价格</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="pledgeUnitPrice" id="pledgeUnitPrice" value="${this.otherCollateral?.pledgeUnitPrice}"/>
                        </div>
                        <label class="col-md-2 control-label is-required">出质价值</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="pledgeTotalPrice" id="pledgeTotalPrice" value="${this.otherCollateral?.pledgeTotalPrice}"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">盯市关联</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="marktoMarket" id="marktoMarket" value="${this.otherCollateral?.marktoMarket}"/>
                        </div>
                        <label class="col-md-2 control-label is-required">价格波动范围(元)</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="rangeOffluctuation" id="rangeOffluctuation" value="${this.otherCollateral?.rangeOffluctuation}"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">是否购买保险</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="isPurchaseInsurance" id="isPurchaseInsurance" value="${this.otherCollateral?.isPurchaseInsurance}"/>
                        </div>
                        <label class="col-md-2 control-label is-required">赎货截止日期</label>
                        <div class="col-md-3">                            
                        <g:datePicker class="form-control" name="endDate" value="${new Date()}" precision="day"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">警戒线设定值</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="guardLineValue" id="guardLineValue" value="${this.otherCollateral?.guardLineValue}"/>
                        </div>
                        <label class="col-md-2 control-label is-required">平仓线设定值</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="flatLineValue" id="flatLineValue" value="${this.otherCollateral?.flatLineValue}"/>
                        </div>

                    </div>













                    <div class="form-group">
                        <label class="col-md-2 control-label">变现能力</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="cashability" id="cashability" from="${com.cindata.dictionary.Cashability.list()}" optionValue="name" optionKey="id" value="${this?.otherCollateral?.cashability?.id}" noSelection="${['': '请选择变现能力']}"/>
                        </div>
                        <label class="col-md-2 control-label">价值波动性</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="valueVolatility" id="valueVolatility" value="${this.otherCollateral?.valueVolatility}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">查封便利性</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="seizureOfConvenience" id="seizureOfConvenience" value="${this.otherCollateral?.seizureOfConvenience}"/>
                        </div>
                        <label class="col-md-2 control-label">抵质押物与借款人相关性</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="relationOfMortgagor" id="relationOfMortgagor" value="${this.otherCollateral?.relationOfMortgagor}"/>
                        </div>
                    </div>

                    <div class="form-group">

                        <label class="col-md-2 control-label">法律有效性</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="legalValidity" id="legalValidity" value="${this.otherCollateral?.legalValidity}"/>
                        </div>
                        <label class="col-md-2 control-label">初次认定价值</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="firstEvaluatePrice" id="firstEvaluatePrice" value="${this.otherCollateral?.firstEvaluatePrice}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">初次评估机构</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="firstEvaluateAccount" id="firstEvaluateAccount" from="${com.cindata.Account.findAllByType(com.cindata.dictionary.AccountTypeDict.EVALUATE())}" optionValue="name" optionKey="id" value="${this.otherCollateral?.firstEvaluateAccount}" noSelection="${['': '请选择初次评估机构']}"/>
                        </div>
                        <label class="col-md-2 control-label">最新认定价值</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="latestEvaluatePrice" id="latestEvaluatePrice" value="${this.otherCollateral?.latestEvaluatePrice}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">最新评估机构</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="latestEvaluateAccount" id="latestEvaluateAccount" from="${com.cindata.Account.findAllByType(com.cindata.dictionary.AccountTypeDict.EVALUATE())}" optionValue="name" optionKey="id" value="${this.otherCollateral?.latestEvaluateAccount}" noSelection="${['': '请选择最新评估机构']}"/>
                        </div>
                        <label class="col-md-2 control-label">最新评估日期</label>
                        <div class="col-md-3">
                            <g:datePicker class="form-control" name="latestEvaluateDate" value="${new Date()}" precision="day"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">下次评估日期</label>
                        <div class="col-md-3">
                            <g:datePicker class="form-control" name="nextEvaluateDate" value="${new Date()}" precision="day"/>
                        </div>

                        <label class="col-md-2 control-label">实际抵质押率</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="actualMortgageRate" id="actualMortgageRate" value="${this.otherCollateral?.actualMortgageRate}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">抵质押率上限</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="mortgageRateUpperLimit" id="mortgageRateUpperLimit" value="${this.otherCollateral?.mortgageRateUpperLimit}"/>
                        </div>

                        <label class="col-md-2 control-label">抵质押物说明</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="description" id="description" value="${this.otherCollateral?.description}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">登记人</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="registerFullName" id="registerFullName" value="${this.otherCollateral?.registerFullName}"/>
                        </div>

                        <label class="col-md-2 control-label">登记机构</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="registerAccount" id="registerAccount" value="${this.otherCollateral?.registerAccount}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">登记日期</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="registerDate" id="registerDate" value="${this.otherCollateral?.registerDate}"/>
                        </div>

                        <label class="col-md-2 control-label">更新日期</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="registerUpdateDate" id="registerUpdateDate" value="${this.otherCollateral?.registerUpdateDate}"/>
                        </div>
                    </div>








                    <div class="form-group">
                        <div class="col-md-3 col-md-offset-6">
                            <g:submitButton class="btn btn-info" name="create" value="保存"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</g:form>



</body>
</html>
